package com.qdev.apps.core.persistence.impl;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.cfg.Configuration;

import org.springframework.orm.hibernate.LocalSessionFactoryBean;

/**
 * @author Quake Wang
 * @since 2004-8-9
 * @version $Revision: 1.2 $
 */
public class DefaultSessionFactoryBean extends LocalSessionFactoryBean {
    protected Configuration newConfiguration() throws HibernateException {
        Configuration config = new Configuration();
        config.setNamingStrategy(UnderscoreNamingStrategy.INSTANCE);
        return config;
    }

    public void setTablePrefix(String tablePrefix) {
        UnderscoreNamingStrategy.INSTANCE.setTablePrefix(tablePrefix);
    }
}